/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CreateOrderDialog.java
 *
 * Created on 2009-12-6, 1:00:00
 */
package com.ordering.menu;

import com.ordering.dao.TFoodTypeJpaController;
import com.ordering.dao.TMenuJpaController;
import com.ordering.dao.exceptions.NonexistentEntityException;
import com.ordering.pojo.TFoodType;
import com.ordering.pojo.TMenu;
import com.ordering.utils.WindowLocationUtils;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;

/**
 *
 * @author sulan
 */
public class ManageMenuDialog extends javax.swing.JDialog {

    /** Creates new form CreateOrderDialog */
    public ManageMenuDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();

        WindowLocationUtils.setWindowCenter(this);
        //tree
        rootNode = new DefaultMutableTreeNode("菜谱");

        tm = new DefaultTreeModel(rootNode);
        jTree1.setModel(tm);
        this.initTree();
        jTree1.expandPath(new TreePath(((DefaultMutableTreeNode) rootNode).getPath()));

        this.initPopupMenu();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPopupMenu1 = new javax.swing.JPopupMenu();
        tOrderHead1 = new com.ordering.pojo.TOrderHead();
        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        contentPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        foodNameText = new javax.swing.JTextField();
        foodTypeText = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        priceText = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        foodDesc = new javax.swing.JTextArea();
        photoLabel = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        foodTypePhotoLabel = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();

        jPopupMenu1.setName("jPopupMenu1"); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(750, 600));
        getContentPane().setLayout(null);

        jSplitPane1.setDividerLocation(200);
        jSplitPane1.setLastDividerLocation(1000);
        jSplitPane1.setName("jSplitPane1"); // NOI18N
        jSplitPane1.setPreferredSize(new java.awt.Dimension(434, 600));

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jTree1.setName("jTree1"); // NOI18N
        jTree1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTree1MouseClicked(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jTree1MouseReleased(evt);
            }
        });
        jTree1.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                jTree1ValueChanged(evt);
            }
        });
        jScrollPane2.setViewportView(jTree1);

        jScrollPane1.setViewportView(jScrollPane2);

        jSplitPane1.setLeftComponent(jScrollPane1);

        contentPanel.setName("contentPanel"); // NOI18N

        jLabel1.setText("菜名:");
        jLabel1.setName("jLabel1"); // NOI18N

        foodNameText.setEditable(false);
        foodNameText.setEnabled(false);
        foodNameText.setName("foodNameText"); // NOI18N
        foodNameText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                foodNameTextActionPerformed(evt);
            }
        });

        foodTypeText.setEditable(false);
        foodTypeText.setEnabled(false);
        foodTypeText.setName("foodTypeText"); // NOI18N
        foodTypeText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                foodTypeTextActionPerformed(evt);
            }
        });

        jLabel2.setText("种类:");
        jLabel2.setName("jLabel2"); // NOI18N

        priceText.setEditable(false);
        priceText.setEnabled(false);
        priceText.setName("priceText"); // NOI18N
        priceText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                priceTextActionPerformed(evt);
            }
        });

        jLabel3.setText("单价:");
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setText("描述:");
        jLabel4.setName("jLabel4"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        foodDesc.setColumns(20);
        foodDesc.setEditable(false);
        foodDesc.setRows(3);
        foodDesc.setEnabled(false);
        foodDesc.setName("foodDesc"); // NOI18N
        jScrollPane3.setViewportView(foodDesc);

        photoLabel.setText("暂无图片");
        photoLabel.setName("photoLabel"); // NOI18N
        photoLabel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                photoLabelMouseClicked(evt);
            }
        });

        jSeparator1.setName("jSeparator1"); // NOI18N

        foodTypePhotoLabel.setText("暂无图片");
        foodTypePhotoLabel.setName("foodTypePhotoLabel"); // NOI18N
        foodTypePhotoLabel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                foodTypePhotoLabelMouseClicked(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("宋体", 0, 14));
        jLabel5.setText("说明：需要增加菜的种类或菜，请选择左侧树，");
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setFont(new java.awt.Font("宋体", 0, 14));
        jLabel6.setText("点鼠标右键对菜谱进行管理");
        jLabel6.setName("jLabel6"); // NOI18N

        javax.swing.GroupLayout contentPanelLayout = new javax.swing.GroupLayout(contentPanel);
        contentPanel.setLayout(contentPanelLayout);
        contentPanelLayout.setHorizontalGroup(
            contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(contentPanelLayout.createSequentialGroup()
                .addGap(65, 65, 65)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                .addGap(10, 10, 10))
            .addGroup(contentPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(priceText, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
                    .addComponent(foodNameText, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
                    .addComponent(foodTypeText, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(photoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(foodTypePhotoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(47, 47, 47))
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE)
            .addGroup(contentPanelLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, contentPanelLayout.createSequentialGroup()
                .addGap(57, 57, 57)
                .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 357, Short.MAX_VALUE)
                .addContainerGap())
        );

        contentPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {foodNameText, foodTypeText, priceText});

        contentPanelLayout.setVerticalGroup(
            contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(contentPanelLayout.createSequentialGroup()
                .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(contentPanelLayout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE)
                            .addComponent(foodTypeText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(55, 55, 55))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, contentPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(foodTypePhotoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(contentPanelLayout.createSequentialGroup()
                        .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE)
                            .addComponent(foodNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)
                        .addGap(31, 31, 31))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, contentPanelLayout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(photoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(contentPanelLayout.createSequentialGroup()
                                .addGap(39, 39, 39)
                                .addComponent(priceText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                .addGroup(contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(58, 58, 58)
                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(152, 152, 152))
        );

        jSplitPane1.setRightComponent(contentPanel);

        getContentPane().add(jSplitPane1);
        jSplitPane1.setBounds(10, 40, 630, 550);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTree1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTree1MouseClicked
    }//GEN-LAST:event_jTree1MouseClicked

    private void jTree1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTree1MouseReleased
        if (evt.isPopupTrigger()) {
            DefaultMutableTreeNode node = (DefaultMutableTreeNode) jTree1.getLastSelectedPathComponent();
            if (node == null || node.getUserObject() == null) {
                return;
            }
            jPopupMenu1.show(evt.getComponent(), evt.getX(), evt.getY());

        }
}//GEN-LAST:event_jTree1MouseReleased

    private void jTree1ValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_jTree1ValueChanged
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) evt.getPath().getLastPathComponent();
        Object o = node.getUserObject();
        if (o instanceof TMenu) {
            TMenu menu = (TMenu) o;
            foodNameText.setText(menu.getFoodName());
            foodTypeText.setText(String.valueOf(menu.getFoodTypeOid()));
            priceText.setText(String.valueOf(menu.getPrice()));
            foodDesc.setText(menu.getDescription());

            String photoName = menu.getPhotoName();


            File file = new File("pic/" + photoName);
            photoLabel.setIcon(new ImageIcon(file.getPath()));

            DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
            TFoodType foodType = (TFoodType) parentNode.getUserObject();
            File foodTypeFile = new File("pic/" + foodType.getPhotoName());
            foodTypePhotoLabel.setIcon(new ImageIcon(foodTypeFile.getPath()));
        } else if (o instanceof TFoodType) {
            TFoodType foodType = (TFoodType) o;
            File foodTypeFile = new File("pic/" + foodType.getPhotoName());
            foodTypePhotoLabel.setIcon(new ImageIcon(foodTypeFile.getPath()));
        }
        System.out.println("You selected " + node);
}//GEN-LAST:event_jTree1ValueChanged

    private void foodNameTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_foodNameTextActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_foodNameTextActionPerformed

    private void foodTypeTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_foodTypeTextActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_foodTypeTextActionPerformed

    private void priceTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_priceTextActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_priceTextActionPerformed

    private void photoLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_photoLabelMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_photoLabelMouseClicked

    private void foodTypePhotoLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_foodTypePhotoLabelMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_foodTypePhotoLabelMouseClicked

    private void initTree() {
        TFoodTypeJpaController jpa = new TFoodTypeJpaController();
        List<TFoodType> tfoodTypeList = jpa.findTFoodTypeEntities();
        for (TFoodType fd : tfoodTypeList) {
            DefaultMutableTreeNode foodTypeNode = new DefaultMutableTreeNode(fd);
            rootNode.add(foodTypeNode);

            for (TMenu menu : fd.getTMenuCollection()) {
                DefaultMutableTreeNode menuNode = new DefaultMutableTreeNode(menu);
                foodTypeNode.add(menuNode);
            }
        }
    }

    private void refreshTree() {
        DefaultMutableTreeNode rootNode;
        DefaultTreeModel tm;
        //tree
        rootNode = new DefaultMutableTreeNode("菜谱");
        tm = new DefaultTreeModel(rootNode);
        jTree1.setModel(tm);

        TFoodTypeJpaController jpa = new TFoodTypeJpaController();
        List<TFoodType> tfoodTypeList = jpa.findTFoodTypeEntities();
        for (TFoodType fd : tfoodTypeList) {
            DefaultMutableTreeNode foodTypeNode = new DefaultMutableTreeNode(fd);
            rootNode.add(foodTypeNode);

            for (TMenu menu : fd.getTMenuCollection()) {
                DefaultMutableTreeNode menuNode = new DefaultMutableTreeNode(menu);
                foodTypeNode.add(menuNode);
            }
        }
        jTree1.expandPath(new TreePath(((DefaultMutableTreeNode) rootNode).getPath()));
    }

    private void initPopupMenu() {
        //popupmenu
        JMenuItem addItem = new JMenuItem("添加");

        addItem.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) jTree1.getLastSelectedPathComponent();

                if (node.getUserObject() instanceof TFoodType) {
                    AddFoodDialog dialog = new AddFoodDialog(null, true, jScrollPane1, jTree1, (TFoodType) node.getUserObject());
                    dialog.setVisible(true);
                } else if (node.isRoot()) {
                    AddFoodTypeDialog dialog = new AddFoodTypeDialog(null, true, jScrollPane1, jTree1);
                    dialog.setVisible(true);
                } else if (node.getUserObject() instanceof TMenu) {
                    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
                    AddFoodDialog dialog = new AddFoodDialog(null, true, jScrollPane1, jTree1, (TFoodType) parentNode.getUserObject());
                    dialog.setVisible(true);
                }
            }
        });
        jPopupMenu1.add(addItem);

        JMenuItem deleteItem = new JMenuItem("删除");
        deleteItem.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) jTree1.getLastSelectedPathComponent();
                if (node.isRoot()) {
                    JOptionPane.showMessageDialog(null, "根节点不能进行删除！", "删除失败", JOptionPane.ERROR_MESSAGE);
                    return;
                } else if (!node.isLeaf()) {
                    JOptionPane.showMessageDialog(null, "此种类下面还有菜，必须删除完菜才能删除菜类型！", "删除失败", JOptionPane.ERROR_MESSAGE);
                    return;
                } else {
                    Object userObject = node.getUserObject();
                    if (userObject instanceof TFoodType) {
                        TFoodType ft = (TFoodType) userObject;
                        TFoodTypeJpaController jpa = new TFoodTypeJpaController();
                        try {
                            jpa.destroy(ft.getFoodTypeOid());
                        } catch (NonexistentEntityException ex) {
                            Logger.getLogger(ManageMenuDialog.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    } else if (userObject instanceof TMenu) {
                        TMenu menu = (TMenu) userObject;
                        TMenuJpaController jpa = new TMenuJpaController();
                        try {
                            jpa.destroy(menu.getMenuId());
                        } catch (NonexistentEntityException ex) {
                            Logger.getLogger(ManageMenuDialog.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                    refreshTree();
                    jScrollPane1.repaint();
                    JOptionPane.showMessageDialog(null, "删除成功！", "删除成功", JOptionPane.INFORMATION_MESSAGE);
                }
                System.out.println("点击删除");
            }
        });
        jPopupMenu1.add(deleteItem);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                final ManageMenuDialog dialog = new ManageMenuDialog(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        dialog.dispose();
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    DefaultMutableTreeNode rootNode;
    DefaultTreeModel tm;
    DefaultTableModel dtm;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel contentPanel;
    private javax.swing.JTextArea foodDesc;
    private javax.swing.JTextField foodNameText;
    private javax.swing.JLabel foodTypePhotoLabel;
    private javax.swing.JTextField foodTypeText;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTree jTree1;
    private javax.swing.JLabel photoLabel;
    private javax.swing.JTextField priceText;
    private com.ordering.pojo.TOrderHead tOrderHead1;
    // End of variables declaration//GEN-END:variables
}
